var gameName : String = "Jon's saved game";

var livesLeft : int = 4;

function Save (slotNumber : int) {

  if(slotNumber > PlayerPrefs.GetInt("saveFiles", 0))//how many save files are there?

  PlayerPrefs.SetInt("saveFiles", slotNumber);

  PlayerPrefs.SetString("SaveFileName" + slotNumber, gameName);

  PlayerPrefs.SetInt("livesLeft" + slotNumber, livesLeft);

}

 

function Load (slotNumber : int) {

  if(slotNumber > PlayerPrefs.GetInt("saveFiles", 0)) {

    Debug.Log("Invalid save slot specified");

    return;

  }

  

  gameName = PlayerPrefs.GetString("SaveFileName" + slotNumber);

  livesLeft = PlayerPrefs.GetInt("livesLeft" + slotNumber);

}
